import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHashHistory as createHistory } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    meta: {
      alive: false
    },
    component: () => import('@/views/home/index.vue')
  },
  {
    path: '/zone',
    name: 'zone',
    component: () => import('@/views/zone/index.vue')
  },
  {
    path: '/zone/video',
    name: 'videoZone',
    meta: {
      alive: true
    },
    component: () => import('@/views/video-zone/index.vue')
  },
  {
    path: '/zone/video/search',
    name: 'videoZoneSearch',
    component: () => import('@/views/video-zone/search.vue')
  },
  {
    path: '/my',
    name: 'My',
    component: () => import('@/views/my/index.vue')
  },
  {
    path: '/my/myFavourite',
    name: 'myFavourite',
    component: () => import('@/views/fav/index.vue')
  },
  {
    path: '/msg',
    name: 'Msg',
    meta: {
      alive: true
    },
    component: () => import('@/views/msg/index2.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/index.vue')
  },
  {
    path: '/anomalyIndex',
    name: 'AnomalyIndex',
    component: () => import('@/views/anomalyIndex/index.vue')
  },
  {
    path: '/msgSend',
    name: 'MsgSend',
    component: () => import('@/views/msgSend/index.vue')
  },
  {
    path: '/msgContent/:id',
    name: 'MsgContent',
    component: () => import('@/views/msgContent/index.vue')
  },
  {
    path: '/my/changePassword',
    name: 'ChangePassword',
    component: () => import('@/views/my/changePassword/index.vue')
  },
  {
    path: '/my/feedback',
    name: 'Feedback',
    component: () => import('@/views/my/feedback/index.vue')
  },
  {
    path: '/my/share',
    name: 'Share',
    component: () => import('@/views/my/share/index.vue')
  },
  {
    path: '/ai',
    name: 'Ai',
    component: () => import('@/views/ai/index2.vue')
  },
  {
    path: '/ai/export',
    name: 'AiExport',
    component: () => import('@/views/ai/export.vue')
  },
  {
    path: '/calendar',
    name: 'Calendar',
    component: () => import('@/views/calendar/index.vue')
  },
  {
    path: '/calendar/add',
    name: 'CalendarAdd',
    component: () => import('@/views/calendar/add.vue')
  },
  {
    path: '/event',
    name: 'event',
    component: () => import('@/views/event/index.vue')
  },
  {
    // 重大事件详情页
    path: '/event/detail',
    name: 'eventDetail',
    component: () => import('@/views/event/detail.vue')
  },
  {
    // 民生事件-重点关注
    path: '/event/livelihood',
    name: 'EventLivelihood',
    component: () => import('@/views/livelihood/index.vue')
  },
  {
    // 民生事件-问题列表
    path: '/event/livelihood/list',
    name: 'livelihoodList',
    component: () => import('@/views/livelihood/list.vue')
  },
  {
    // 民生事件-问题详情
    path: '/event/livelihood/detail',
    name: 'livelihoodDetail',
    component: () => import('@/views/livelihood/detail.vue')
  },
  // 民生事件-热词下钻
  {
    path: '/event/livelihood/hotWord',
    name: 'livelihoodHotWord',
    component: () => import('@/views/livelihood/hotWord.vue')
  },
  {
    // 重点指标
    path: '/keyIndicator',
    name: 'keyIndicator',
    component: () => import('@/views/keyIndicator/index.vue')
  },
  {
    // 通讯录
    path: '/contact',
    name: 'contact',
    meta: {
      alive: true
    },
    component: () => import('@/views/contact/index.vue')
  },
  {
    // 通讯录-搜索
    path: '/contact/search',
    name: 'contactSearch',
    component: () => import('@/views/contact/search.vue')
  },
  {
    // 通讯录-详情
    path: '/contact/detail',
    name: 'contactDetail',
    component: () => import('@/views/contact/detail.vue')
  },
  {
    // 通讯录-消息
    path: '/contact/talk',
    name: 'contactTalk',
    component: () => import('@/views/contact/talk.vue')
  },
  // 项目专区
  {
    path: '/project',
    name: 'project',
    meta: {
      alive: true
    },
    component: () => import('@/views/project/index.vue')
  },
  // 项目详情页
  {
    path: '/project/detail',
    name: 'projectDetail',
    meta: {
      // alive: true
    },
    component: () => import('@/views/project/components/projectDetail.vue')
  },
  // 重点工作页
  {
    path: '/keyWork',
    name: 'keyWork',
    component: () => import('@/views/keyWork/index.vue')
  },
  // 重点工作搜索
  {
    path: '/keyWork/search',
    name: 'keyWorkSearch',
    meta: {
      alive: true
    },
    component: () => import('@/views/keyWork/components/search.vue')
  },
  // 重点工作详情
  {
    path: '/keyWork/detail',
    name: 'keyWorkDetail',
    component: () => import('@/views/keyWork/components/detail.vue')
  }
]

export default createRouter({
  history: createHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
  routes
})
